const express = require('express');
const cookieParser = require('cookie-parser');
const cookieSession = require('cookie-session');

const server = express();

// session

// 添加密钥

server.use(cookieParser());
server.use(cookieSession({
    keys : ['aaa', 'bbb', 'ccc'],
    name: 'blue',
    maxAge: 2*1000

}));

server.use('/aaa/a.html', (req, res) => {

    console.log(req.session);
    res.send('ok');
});

server.listen(8080, () => {
    console.log('服务启动成功!');
});

